package com.tm.dk.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tm.dk.service.MonService;
import com.tm.entity.MessageEntity;
import com.tm.entity.MeterEntity;
import com.tm.entity.dto.MonDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("mon")
public class MonController {
    @Autowired
    private MonService monService;

    @GetMapping("page")
    public Page<MessageEntity> page(@RequestBody MonDTO monDTO){
        QueryWrapper<MessageEntity> wrapper = new QueryWrapper<MessageEntity>();
        wrapper.like("company",monDTO.getCompany());
        Page<MessageEntity> page = new Page<MessageEntity>(monDTO.getPage(),monDTO.getPageSize());
        return monService.page(page,wrapper);
    }


}
